import Vue from 'vue'
import VueRouter, { RouteConfig } from 'vue-router'
import Home from '../views/Home.vue'
import Role from '../views/Role.vue'
import Test from '../views/Test.vue'
import Login from '../views/Login.vue'
import Index from '../views/Index.vue'
import Product from '../views/Product.vue'

Vue.use(VueRouter)

const routes: Array<RouteConfig> = [
    {
        path: '/index',
        name: 'Index',
        component: () => import(/* webpackChunkName: "about" */ '../views/Index.vue'),
        children:[]
    },
    {
        path: '/',
        name: 'Login',
        component: Login
    },
    {
        path: '/product',
        name: 'Product',
        component: Product
    }
]


const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
